//
//  Activity.swift
//  BUYOU
//
//  Created by tyuu on 2024/6/1.
//

import HandyJSON

class RunActivity: HandyJSON {
    
    var  activityId: String = ""
    var  name: String = ""
    var  description: String = ""
    var  dateTime: String = ""
    var  location: Location?
    var  distance: Int = 0
    var  maxParticipants: Int = 0
    var  currentParticipants: Int = 0
    var  organizer: Organizer?
    var  status: String = ""
    var  registrationDeadline: String  = ""
    var  coverImageUrl: String  = ""
    var  participants: [Participant] = []
    var  createdAt: String  = ""
    var  updatedAt: String = ""
    
    required init() {
        
    }
    
    static let jsonString = """
[
  {
    "activityId": "1",
    "name": "城市公园晨跑",
    "description": "加入我们，在城市公园进行一次清晨跑步，欢迎所有跑步爱好者参加！",
    "dateTime": "2024-06-05T08:00:00+08:00",
    "location": {
      "address": "上海市城市公园主入口",
      "latitude": 31.2304,
      "longitude": 121.4737
    },
    "distance": 5,
    "maxParticipants": 50,
    "currentParticipants": 30,
    "organizer": {
      "userId": "u123",
      "name": "东边的张三",
      "profileImageUrl": ""
    },
    "status": "即将开始",
    "registrationDeadline": "2024-06-04T23:59:59+08:00",
    "coverImageUrl": "acc01",
    "participants": [
      {
        "userId": "u124",
        "name": "西边的李四",
        "profileImageUrl": "buyou1"
      },
      {
        "userId": "u125",
        "name": "南边的王五",
        "profileImageUrl": "buyou2"
      }
    ],
    "createdAt": "2024-05-20T10:00:00+08:00",
    "updatedAt": "2024-05-25T15:00:00+08:00"
  },
  {
    "activityId": "2",
    "name": "海滩日落跑",
    "description": "在美丽的日落时分，来一次海滩跑步吧！记得带上水哦！",
    "dateTime": "2024-06-10T19:00:00+08:00",
    "location": {
      "address": "深圳市日落海滩，救生员塔3",
      "latitude": 22.5431,
      "longitude": 114.0579
    },
    "distance": 10,
    "maxParticipants": 30,
    "currentParticipants": 18,
    "organizer": {
      "userId": "u126",
      "name": "赵六",
      "profileImageUrl": ""
    },
    "status": "即将开始",
    "registrationDeadline": "2024-06-09T23:59:59+08:00",
    "coverImageUrl": "acc02",
    "participants": [
      {
        "userId": "u127",
        "name": "孙七",
        "profileImageUrl": "buyou3"
      },
      {
        "userId": "u128",
        "name": "周八",
        "profileImageUrl": "buyou4"
      }
    ],
    "createdAt": "2024-05-22T12:00:00+08:00",
    "updatedAt": "2024-05-28T10:00:00+08:00"
  },
  {
    "activityId": "3",
    "name": "山间晨跑",
    "description": "享受大自然的清新空气，来一场充满活力的山间晨跑吧！",
    "dateTime": "2024-06-15T06:00:00+08:00",
    "location": {
      "address": "北京市香山公园南门",
      "latitude": 39.9896,
      "longitude": 116.1780
    },
    "distance": 8,
    "maxParticipants": 40,
    "currentParticipants": 25,
    "organizer": {
      "userId": "u129",
      "name": "王小明",
      "profileImageUrl": ""
    },
    "status": "即将开始",
    "registrationDeadline": "2024-06-14T23:59:59+08:00",
    "coverImageUrl": "acc03",
    "participants": [
      {
        "userId": "u130",
        "name": "李雷",
        "profileImageUrl": "buyou5"
      },
      {
        "userId": "u131",
        "name": "韩梅梅",
        "profileImageUrl": "buyou1"
      }
    ],
    "createdAt": "2024-05-25T09:00:00+08:00",
    "updatedAt": "2024-05-30T11:00:00+08:00"
  },
  {
    "activityId": "4",
    "name": "环湖慢跑",
    "description": "来一次环湖慢跑，享受湖边的宁静和美景。",
    "dateTime": "2024-06-20T07:00:00+08:00",
    "location": {
      "address": "杭州市西湖公园东门",
      "latitude": 30.2500,
      "longitude": 120.2000
    },
    "distance": 7,
    "maxParticipants": 35,
    "currentParticipants": 20,
    "organizer": {
      "userId": "u132",
      "name": "陈晓",
      "profileImageUrl": ""
    },
    "status": "即将开始",
    "registrationDeadline": "2024-06-19T23:59:59+08:00",
    "coverImageUrl": "acc04",
    "participants": [
      {
        "userId": "u133",
        "name": "胡凯",
        "profileImageUrl": "buyou2"
      },
      {
        "userId": "u134",
        "name": "刘芳",
        "profileImageUrl": "buyou3"
      }
    ],
    "createdAt": "2024-06-01T08:00:00+08:00",
    "updatedAt": "2024-06-05T14:00:00+08:00"
  },
  {
    "activityId": "5",
    "name": "江边夜跑",
    "description": "江边夜跑，享受清凉的夜风和城市的夜景。",
    "dateTime": "2024-06-25T20:00:00+08:00",
    "location": {
      "address": "武汉市江滩公园南门",
      "latitude": 30.5800,
      "longitude": 114.2700
    },
    "distance": 5,
    "maxParticipants": 40,
    "currentParticipants": 22,
    "organizer": {
      "userId": "u135",
      "name": "刘伟",
      "profileImageUrl": ""
    },
    "status": "即将开始",
    "registrationDeadline": "2024-06-24T23:59:59+08:00",
    "coverImageUrl": "acc05",
    "participants": [
      {
        "userId": "u136",
        "name": "赵明",
        "profileImageUrl": "buyou4"
      }
    ],
    "createdAt": "2024-06-05T09:00:00+08:00",
    "updatedAt": "2024-06-10T12:00:00+08:00"
  }
]


"""
    
}


class Location: HandyJSON {
    var address: String = ""
    var latitude: Double = 0.0
    var longitude: Double = 0.0
    
    required init() {
        
    }
}

class Organizer: HandyJSON {
    var userId: String = ""
    var name: String = ""
    var profileImageUrl: String = ""
    required init() {
        
    }
}

class Participant: HandyJSON {
    var userId: String = ""
    var name: String = ""
    var profileImageUrl: String = ""
    required init() {
        
    }
}
